package com.ecoolex.union.pay.retailer.ws;

import com.ecoolex.framework.common.pojo.Page;
import com.ecoolex.framework.common.pojo.Pagination;
import com.ecoolex.union.pay.retailer.entity.UnionPayCoupon;
import com.ecoolex.union.pay.retailer.pojo.ManulReceiveUnionPayCouponDTO;
import com.ecoolex.union.pay.retailer.pojo.ReceiveUnionPayCouponDTO;
import com.ecoolex.union.pay.retailer.pojo.UnionPayCouponOperateResponse;
import org.springframework.lang.NonNull;

import java.math.BigDecimal;
import java.util.Optional;

public interface UnionPayCouponService {
    Pagination<UnionPayCoupon> getCouponByUserId(Integer userId, @NonNull Page page);

    void receiveUnionPayCoupon(ReceiveUnionPayCouponDTO coupon, Integer userId, String userName);

    UnionPayCoupon manulReceiveUnionPayCoupon(ManulReceiveUnionPayCouponDTO coupon, Integer userId, String userName);

    boolean canUsed(UnionPayCoupon source, BigDecimal realPrice, String currencyType, Integer userId);

    Optional<UnionPayCouponOperateResponse> canUsed(Integer couponId, BigDecimal realPrice, String currencyType, Integer userId);

}
